<?php
include 'lib_conf.php';
include 'lib/tbl_namhoa_document_log.php';

$a_hide_filter  = array(
    'id',
    'type',
    'updatedate',
);

function make_where(&$s_Where, &$a_filterings) {
    $s_category1 = $a_filterings['category1'    ];
    $s_category2 = $a_filterings['category2'    ];
    $s_category3 = $a_filterings['category3'    ];
    $s_category4 = $a_filterings['category4'    ];
    $s_category5 = $a_filterings['category5'    ];
    $s_category6 = $a_filterings['category6'    ];
    $s_category7 = $a_filterings['category7'    ];
    $s_field1    = $a_filterings['field1'       ];
    $s_keyword1  = $a_filterings['keyword1'     ];
    $s_field2    = $a_filterings['field2'       ];
    $s_keyword2  = $a_filterings['keyword2'     ];
    $s_field3    = $a_filterings['field3'       ];
    $s_keyword3  = $a_filterings['keyword3'     ];
    
    if ($s_category1) {
        $s_category1 = preg_replace('/(\d+).(\d+).(\d+)/', '$3-$2-$1', $s_category1);
        $s_Where     = $s_Where . " and updatedate like '$s_category1%'";
    }
    
    $v_filter = make_advanced_filter_namhoa_document_log($s_field1, $s_keyword1);
    
    if ($v_filter) { $s_Where = $s_Where  . ' and ' . $v_filter; }
}
?>